﻿CREATE TABLE DBDictionary.DBAction(
	ID										uniqueidentifier PRIMARY KEY,
	Type									varchar(32) NOT NULL,
	DateCreation							datetime2 NOT NULL,
	DateExercice							datetime2 NOT NULL,
	Name									varchar(64) NOT NULL,
	DBInstrumentStaticDataID				uniqueidentifier NOT NULL,		/* On instrument with such ID */
	Enabled									bit NOT NULL default(1),
				    
    CHECK( 
		Type in (
			'Dividend',
			'Split',
			'FreeStocks') 
	),
    
    /* Aggregable Fields, see views. Be warned to keep the same field names in both view and table, else the auto CopyProperties C# method won't work */
	Ratio									float,
	Quantity								int,
	Price									float,
);
